//package tcg.serialization;
//
//
//import java.util.concurrent.ConcurrentMap;
//
//import com.hazelcast.core.Hazelcast;
//
//import de.justphil.tcg.tcgserver.game.mechanics.config.Config;
//import de.justphil.tcg.tcgserver.game.mechanics.example.DeckCreator;
//import de.justphil.tcg.tcgserver.game.mechanics.game.Game;
//import de.justphil.tcg.tcgserver.game.mechanics.gui.Board;
//import de.justphil.tcg.tcgserver.game.mechanics.monster.MonsterList;
//import de.justphil.tcg.tcgserver.commons.config.GridConfig;
//import de.justphil.tcg.tcgserver.commons.grid.Grid;
//
//public class GameSerializationTest {
//	
//	private ConcurrentMap<Integer, Game> gamesMap;
//	
//	public static void main(String[] args) {
//		GameSerializationTest test = new GameSerializationTest();
//		test.setUp();
//		
//		test.testGameSerializationAndDeserialization();
//		
//		test.tearDown();
//	}
//
//	
//	public void setUp() {
//		Grid.init();
//		gamesMap = Hazelcast.getMap(GridConfig.GRID_TEST_GAMES);
//	}
//
//	
//	public void tearDown() {
//		gamesMap = null;
//		Grid.shutdownAll();
//	}
//
//	
//	public void testGameSerializationAndDeserialization() {
//
//		// creation of Game object
//		DeckCreator deckCreator = new DeckCreator();
//
//		MonsterList[] decks = {
//				deckCreator.getRandomDeck(Config.DECK1_SEED),
//				deckCreator.getRandomDeck(Config.DECK2_SEED) };
//		Game game = new Game(decks);
//		Board board = new Board(game);
//		
//		game.addOnGameProgressListener(board);
//		board.addOnUserInteractionListener(game);
//		
//
//		game.onResume();
//		
//		
//		// write Game object into cluster
//		gamesMap.put(1, game);
//		
//		// read Game object from cluster
//		Game reconstructedGame = gamesMap.get(1);
//		
//		game.removeOnGameProgressListener(board);
//		board.removeOnUserInteractionListener(game);
//
//		reconstructedGame.addOnGameProgressListener(board);
//		board.setGame(reconstructedGame);
//		board.addOnUserInteractionListener(reconstructedGame);
//	}
//
//}
